/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.psdk;

import android.text.TextUtils;
import com.qihoo.psdk.util.h;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Vector;
import org.json.JSONArray;
import org.json.JSONObject;

public class d {
    private static String b = "HistoryBean";
    public Map a = null;

    public void a() {
        if (this.a == null)
            return;
        Iterator localIterator = this.a.entrySet().iterator();
        for (Vector localVector = null; localIterator.hasNext(); localVector = null) {
            Map.Entry localEntry = (Map.Entry) localIterator.next();
            localVector = (Vector) localEntry.getValue();
            Map localMap = null;
            for (int i = 0; i < localVector.size(); ++i) {
                localMap = ((c) localVector.get(i)).c;
                if (localMap == null)
                    continue;
                localMap.clear();
                localMap = null;
            }
            localVector.clear();
        }
        this.a.clear();
        this.a = null;
    }

    public void a(String paramString) {
        try {
            if (TextUtils.isEmpty(paramString))
                return;
            JSONObject localJSONObject1 = new JSONObject(paramString);
            if (localJSONObject1.isNull("event"))
                return;
            JSONObject localJSONObject2 = localJSONObject1.getJSONObject("event");
            String str1 = "";
            JSONArray localJSONArray = null;
            Vector localVector = null;
            Iterator localIterator1 = localJSONObject2.keys();
            while (localIterator1.hasNext()) {
                str1 = (String) localIterator1.next();
                localJSONArray = localJSONObject2.getJSONArray(str1);
                if (localJSONArray == null)
                    continue;
                JSONObject localJSONObject3 = null;
                c localc = null;
                localVector = new Vector();
                for (int i = 0; i < localJSONArray.length(); ++i) {
                    localJSONObject3 = (JSONObject) localJSONArray.opt(i);
                    localc = new c();
                    Iterator localIterator2 = localJSONObject3.keys();
                    String str2 = "";
                    while (localIterator2.hasNext()) {
                        str2 = (String) localIterator2.next();
                        if ("qhId".equals(str2)) {
                            localc.a = localJSONObject3.getString(str2);
                        }
                        else if ("qhTs".equals(str2)) {
                            localc.b = localJSONObject3.getLong(str2);
                        }
                        else {
                            if (localc.c == null)
                                localc.c = new HashMap();
                            localc.c.put(str2, localJSONObject3.getString(str2));
                        }
                    }
                    localVector.add(localc);
                }
                this.a.put(str1, localVector);
            }
        } catch (Exception localException) {
            h.a(b, localException);
        } catch (Error localError) {
            h.a(b, localError);
        }
    }
}